#import "HeatwaveKeepsakeCell.h"


@implementation HeatwaveKeepsakeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self lanternMagnitudeInitUIKit];
	}
	return self;
}

- (void)setJoyousZealot:(HeatwaveKeepsakeModel *)joyousZealot {
	_joyousZealot = joyousZealot;

	//: 配置cell的UI

[self.luminousImageView sd_setImageWithURL:[NSURL URLWithString:joyousZealot.echoes.stringValue] placeholderImage:nil];

	self.wispLabel.text = [joyousZealot.echoes stringValue];

}
//: 设置self.luminousImageView的圆角
- (void)prismElevate:(UIImageView *)driftKaleidoscopeIlluminate odysseyGlisten:(CGFloat)tranquilityPictureKindred {
	driftKaleidoscopeIlluminate.layer.cornerRadius = tranquilityPictureKindred;
	driftKaleidoscopeIlluminate.layer.masksToBounds = YES;
}

- (void)lanternMagnitudeInitUIKit {

    //: 描述_0
    UIView *zenithHumble = [[UIView alloc] initWithFrame:CGRectZero];
    zenithHumble.size = CGSizeMake(56, 110);
    zenithHumble.left = 16;
    zenithHumble.top = 9;
    self.freedomDelightfulIlluminateView = zenithHumble;
    [self.contentView addSubview:zenithHumble];


    //: 描述_1
    self.waffleInvincibleStillnessImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
    self.waffleInvincibleStillnessImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.waffleInvincibleStillnessImageView.clipsToBounds = YES;
    self.waffleInvincibleStillnessImageView.layer.cornerRadius = 11;
    self.waffleInvincibleStillnessImageView.layer.masksToBounds = YES;
    UIImage *unityKeyholeLuminous = [UIImage imageNamed:@"images/image_1.png"];
    if (unityKeyholeLuminous) {
	    self.waffleInvincibleStillnessImageView.image = unityKeyholeLuminous;
    }
    [self.contentView addSubview:self.waffleInvincibleStillnessImageView];
	[self.waffleInvincibleStillnessImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(95);
		make.height.mas_equalTo(73);
		make.bottom.equalTo(@(26));
	}];


    //: 描述_2
    UIView *marvelPulse = [[UIView alloc] initWithFrame:CGRectZero];
    self.sereneView = marvelPulse;
    [self.contentView addSubview:marvelPulse];
	[self.sereneView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(172);
		make.height.mas_equalTo(187);
		make.top.equalTo(@(18));
		make.bottom.equalTo(@(22));
	}];


    //: 描述_3
    self.luminousImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
    self.luminousImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.luminousImageView.clipsToBounds = YES;
    //: UIImageView的骚操作 充数
    [self prismElevate:self.luminousImageView odysseyGlisten:17];
    self.luminousImageView.size = CGSizeMake(197, 113);
    self.luminousImageView.left = 48;
    self.luminousImageView.top = 17;
    UIImage *embarkConquerAbandon = [UIImage imageNamed:@"images/image_3.png"];
    if (embarkConquerAbandon) {
	    self.luminousImageView.image = embarkConquerAbandon;
    }
    [self.contentView addSubview:self.luminousImageView];


    //: 描述_4
    self.wispLabel = [UILabel new];
    self.wispLabel.frame = CGRectMake(9, 45, 115, 166);
    self.wispLabel.text = @"label_4";
    self.wispLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
    self.wispLabel.textColor = [UIColor colorWithRed:2/255.0 green:9/255.0 blue:202/255.0 alpha:1.0];
    self.wispLabel.textAlignment = NSTextAlignmentRight;
    //: 不用理会的骚操作 = self.wispLabel.numberOfLines = 1;
    NSInteger lushWonderHeatwave = 1;
    if (lushWonderHeatwave>44 && lushWonderHeatwave < 5944) {
	    lushWonderHeatwave = 64;
	    NSString *horizonQuicksilverOpulent = [NSString stringWithFormat:@"%ld", (long)lushWonderHeatwave];
	    if (horizonQuicksilverOpulent.length>68 && [horizonQuicksilverOpulent isEqualToString:self.wispLabel.text]) {
		    lushWonderHeatwave = horizonQuicksilverOpulent.integerValue * 9;
	    }
    }
    self.wispLabel.numberOfLines = lushWonderHeatwave;
    [self.contentView addSubview:self.wispLabel];
}


@end